import { createRouter } from 'vue-router'
import { createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    { path: '/', component: () => import('@/views/index/Index.vue')  },
    { path: '/index',name: "Index", component: () => import('@/views/index/Index.vue') },
    { path: '/rank',name: "Rank", component: () => import('@/views/index/Rank.vue') },
    { path: '/gedan',name: "Gedan", component: () => import('@/views/playlist/Gedan.vue') },
    { path: '/gedan/:id',name: "GedanDetail", component: () => import('@/views/playlist/GedanDetail.vue') },
    { path: '/apidoc',name: "ApiDoc", component: () => import('@/views/index/ApiTest.vue') },
    { path: '/historyplay',name: "HistoryPlay", component: () => import('@/views/my/HistoryPlay.vue') },
    { path: '/local',name: "Local", component: () => import('@/views/my/Local.vue') },
    { path: '/mylike',name: "MyLike", component: () => import('@/views/my/MyLike.vue') },
    { path: '/download',name: "Download", component: () => import('@/views/my/Download.vue') },
    { path: '/search',name: "Search", component: () => import('@/views/search/index.vue') },
    { path: '/song',name: "Song", component: () => import('@/views/song/Song.vue') },
    { path: '/singers',name: "Singers", component: () => import('@/views/singer/Singers.vue') },
    { path: '/singers/:id/:tab',name: "SingerDetail", component: () => import('@/views/singer/SingerDetail.vue') },
    { path: '/newsongs',name: "NewSongs", component: () => import('@/views/search/NewSong.vue') },
    { path: '/user',
      children:[
        { path: 'follows',name: "Follows", component: () => import('@/views/user/Follows.vue') },
        { path: 'fans',name: "Fans", component: () => import('@/views/user/Fans.vue') },
        { path: 'userPage',name: "UserPage", component: () => import('@/views/user/UserPage.vue') },
      ]
    },
    { path: '/setting',name: "Setting",
        children:[
          { path: 'theme',name: "Theme", component: () => import('@/views/setting/Theme.vue') },
          { path: 'test',name: "Test", component: () => import('@/views/setting/Test.vue') },
        ]
    },
  ]
})

export default router
